import { addColumnEllipsis, dateRender } from "utils/common";
const columnWidth = 80;

let columns = [
  {
    dataIndex: "id",
    title: "ID",
    align: 'center',
    width: 50
  },
  {
    dataIndex: "goodsName",
    title: "商品名称"
  },
  {
    dataIndex: "category",
    title: "商品类别",
    align: "center",
    scopedSlots: { customRender: "categorySlots" }
  },
  {
    dataIndex: "dictType",
    title: "二级分类",
    align: "center",
  },
  {
    dataIndex: "images",
    title: "商品图片",
    align: "center",
    scopedSlots: { customRender: "imgs" }
  },
  {
    dataIndex: "specType",
    title: "商品规格",
    align: "center",
    width: 60,
    scopedSlots: { customRender: "specType" }
  },
  {
    dataIndex: "deductStockType",
    title: "库存计算方式",
    align: "center",
    width: 90,
    scopedSlots: { customRender: "deductStockType" }
  },
  // {
  //   dataIndex: "deliveryId",
  //   title: "默认价格"
  // },
  // {
  //   dataIndex: "deliveryId",
  //   title: "默认库存"
  // },
  {
    dataIndex: "salesInitial",
    title: "初始销量",
    align: "center"
  },
  {
    dataIndex: "salesActual",
    title: "实际销量",
    align: "center"
  },
  // {
  //   dataIndex: "deliveryId",
  //   title: "运费模版名称"
  // },
  {
    dataIndex: "deliveryId",
    title: "运费模版ID",
    align: "center"
  },
  {
    dataIndex: "goodsStatus",
    title: "商品状态",
    align: "center",
    scopedSlots: { customRender: "goodsStatus" },
    width: 60
  },
  {
    dataIndex: "recommend",
    title: "是否推荐",
    align: "center",
    scopedSlots: { customRender: "recommend" },
    width: 60
  },
  {
    dataIndex: "content",
    align: "center",
    title: "商品详情",
    width: 140
  },
  {
    dataIndex: "intro",
    align: "intro",
    title: "商品简介",
    width: 80
  },
  {
    dataIndex: "createTime",
    align: "center",
    title: "创建时间",
    width: 140
  },
  {
    dataIndex: "modifyTime",
    title: "更新时间",
    align: "center",
    scopedSlots: { customRender: "modifyTime" },
    width: 140
  },
  {
    dataIndex: "goodsSort",
    title: "权重",
    align: "center",
    width: 60
  },
  {
    dataIndex: "operation",
    title: "操作",
    scopedSlots: { customRender: "operation" },
    width: 120,
    align: "center",
    fixed: 'right'
  }
];

columns = addColumnEllipsis(columns);
export default columns;
